<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"
            "http://www.w3.org/TR/REC-html40/loose.dtd">
<HTML>
<HEAD>



<META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<META name="GENERATOR" content="hevea 1.08">
<LINK rel="stylesheet" type="text/css" href="libman.css">
<TITLE>
Various Constraints on Lists
</TITLE>
</HEAD>
<BODY >
<A HREF="libman021.html"><IMG SRC ="contents_motif.gif" ALT="Up"></A>
<A HREF="libman023.html"><IMG SRC ="next_motif.gif" ALT="Next"></A>
<HR>

<H2 CLASS="section"><A NAME="htoc51">4.1</A>&nbsp;&nbsp;Various Constraints on Lists</H2>
The library <B>ic_global</B> implements a number of constraints
over lists of integer variables. It is loaded using one of 
<BLOCKQUOTE CLASS="quote"><PRE CLASS="verbatim">
:- use_module(library(ic_global)).
:- lib(ic_global).
</PRE></BLOCKQUOTE>
The following predicates are provided
<DL CLASS="description" COMPACT=compact><DT CLASS="dt-description">
<A HREF="../bips/lib/ic_global/alldifferent-1.html"><B>alldifferent(+List)</B></A><A NAME="@default128"></A><DD CLASS="dd-description"><BR>
<A NAME="@default129"></A>
A version of alldifferent/1 with strong propagation.<BR>
<BR>
<DT CLASS="dt-description"><A HREF="../bips/lib/ic_global/alldifferent-2.html"><B>alldifferent(+List, ++Capacity)</B></A><A NAME="@default130"></A><DD CLASS="dd-description"><BR>
<A NAME="@default131"></A>
Like alldifferent/1, but every value may occur Capacity times.<BR>
<BR>
<DT CLASS="dt-description"><A HREF="../bips/lib/ic_global/minlist-2.html"><B>minlist(+List, ?Min)</B></A><A NAME="@default132"></A><DD CLASS="dd-description"><BR>
<A NAME="@default133"></A>
Min is the minimum of the values in List.
Operationally: Min gets updated to reflect the current
range of the minimum of variables and values in List.
Likewise, the list elements get constrained to the
minimum given.<BR>
<BR>
<DT CLASS="dt-description"><A HREF="../bips/lib/ic_global/maxlist-2.html"><B>maxlist(+List, ?Max)</B></A><A NAME="@default134"></A><DD CLASS="dd-description"><BR>
<A NAME="@default135"></A>
Max is the maximum of the values in List.
Operationally: Max gets updated to reflect the current
range of the maximum of variables and values in List.
Likewise, the list elements get constrained to the
maximum given.<BR>
<BR>
<DT CLASS="dt-description"><A HREF="../bips/lib/ic_global/lexico_le-2.html"><B>lexico_le(+List1, +List2)</B></A><A NAME="@default136"></A><DD CLASS="dd-description"><BR>
<A NAME="@default137"></A>
Imposes a lexicographic ordering between the two lists.<BR>
<BR>
<DT CLASS="dt-description"><A HREF="../bips/lib/ic_global/ordered-2.html"><B>ordered(++Relation, +List)</B></A><A NAME="@default138"></A><DD CLASS="dd-description"><BR>
<A NAME="@default139"></A>
Constrains List to be ordered according to Relation.
Relation is one of the atoms &lt;, =&lt;, &gt;, &gt;=, = .<BR>
<BR>
<DT CLASS="dt-description"><A HREF="../bips/lib/ic_global/ordered_sum-2.html"><B>ordered_sum(++List, +Sum)</B></A><A NAME="@default140"></A><DD CLASS="dd-description"><BR>
<A NAME="@default141"></A>
The list elements are ordered and their sum is Sum.<BR>
<BR>
<DT CLASS="dt-description"><A HREF="../bips/lib/ic_global/occurrences-3.html"><B>occurrences(++Value, +List, ?N)</B></A><A NAME="@default142"></A><DD CLASS="dd-description"><BR>
<A NAME="@default143"></A>
The value Value occurs in List N times.
Operationally: N gets updated to reflect the number of
possible occurrences in the List. List elements may get
instantiated to Value, or Value may be removed from their
domain if required by N.<BR>
<BR>
<DT CLASS="dt-description"><A HREF="../bips/lib/ic_global/sorted-2.html"><B>sorted(?List, ?Sorted)</B></A><A NAME="@default144"></A><DD CLASS="dd-description"><BR>
<A NAME="@default145"></A>
Sorted is a sorted permutation of List.<BR>
<BR>
<DT CLASS="dt-description"><A HREF="../bips/lib/ic_global/sorted-3.html"><B>sorted(?List, ?Sorted, ?Positions)</B></A><A NAME="@default146"></A><DD CLASS="dd-description"><BR>
<A NAME="@default147"></A>
Sorted is a sorted permutation of List and Positions is a list whose
elements indicating the position of each unsorted list element within
the sorted list.<BR>
<BR>
<DT CLASS="dt-description"><A HREF="../bips/lib/ic_global/sumlist-2.html"><B>sumlist(+List, ?Sum)</B></A><A NAME="@default148"></A><DD CLASS="dd-description"><BR>
<A NAME="@default149"></A>
The sum of the list elements is Sum. This constraint
is more efficient than a general IC sum constraint
if the list is long and Sum is not constrained frequently.</DL>
<HR>
<A HREF="libman021.html"><IMG SRC ="contents_motif.gif" ALT="Up"></A>
<A HREF="libman023.html"><IMG SRC ="next_motif.gif" ALT="Next"></A>
</BODY>
</HTML>
